
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <title>智能计数器 · 学习 RxJS 操作符</title>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.1.1">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="progressbar.html" />
    
    
    <link rel="prev" href="./" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"RxJS-CN","repo":"learn-rxjs-operators","type":"star","size":"small","count":true},{"user":"RxJS-CN","repo":"learn-rxjs-operators","type":"fork","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" >
            
                <a target="_blank" href="https://github.com/RxJS-CN/learn-rxjs-operators">
            
                    
                    学习 RxJS 操作符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../about/README.md">
            
                <span>
            
                    
                    关于中文版
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">学习 RxJS</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../operators/">
            
                <a href="../operators/">
            
                    
                    操作符
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="../operators/combination/">
            
                <a href="../operators/combination/">
            
                    
                    组合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1.1" data-path="../operators/combination/combineall.html">
            
                <a href="../operators/combination/combineall.html">
            
                    
                    combineAll
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.2" data-path="../operators/combination/combinelatest.html">
            
                <a href="../operators/combination/combinelatest.html">
            
                    
                    combineLatest
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.3" data-path="../operators/combination/concat.html">
            
                <a href="../operators/combination/concat.html">
            
                    
                    concat
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.4" data-path="../operators/combination/concatall.html">
            
                <a href="../operators/combination/concatall.html">
            
                    
                    concatAll
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.5" data-path="../operators/combination/forkjoin.html">
            
                <a href="../operators/combination/forkjoin.html">
            
                    
                    forkJoin
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.6" data-path="../operators/combination/merge.html">
            
                <a href="../operators/combination/merge.html">
            
                    
                    merge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.7" data-path="../operators/combination/mergeall.html">
            
                <a href="../operators/combination/mergeall.html">
            
                    
                    mergeAll
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.8" data-path="../operators/combination/pairwise.html">
            
                <a href="../operators/combination/pairwise.html">
            
                    
                    pairwise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.9" data-path="../operators/combination/race.html">
            
                <a href="../operators/combination/race.html">
            
                    
                    race
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.10" data-path="../operators/combination/startwith.html">
            
                <a href="../operators/combination/startwith.html">
            
                    
                    startWith
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.11" data-path="../operators/combination/withlatestfrom.html">
            
                <a href="../operators/combination/withlatestfrom.html">
            
                    
                    withLatestFrom
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.1.12" data-path="../operators/combination/zip.html">
            
                <a href="../operators/combination/zip.html">
            
                    
                    zip
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.2" data-path="../operators/conditional/">
            
                <a href="../operators/conditional/">
            
                    
                    条件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.2.1" data-path="../operators/conditional/defaultifempty.html">
            
                <a href="../operators/conditional/defaultifempty.html">
            
                    
                    defaultIfEmpty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.2.2" data-path="../operators/conditional/every.html">
            
                <a href="../operators/conditional/every.html">
            
                    
                    every
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="../operators/creation/">
            
                <a href="../operators/creation/">
            
                    
                    创建
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.3.1" data-path="../operators/creation/create.html">
            
                <a href="../operators/creation/create.html">
            
                    
                    create
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.2" data-path="../operators/creation/empty.html">
            
                <a href="../operators/creation/empty.html">
            
                    
                    empty
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.3" data-path="../operators/creation/from.html">
            
                <a href="../operators/creation/from.html">
            
                    
                    from
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.4" data-path="../operators/creation/fromevent.html">
            
                <a href="../operators/creation/fromevent.html">
            
                    
                    fromEvent
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.5" data-path="../operators/creation/frompromise.html">
            
                <a href="../operators/creation/frompromise.html">
            
                    
                    fromPromise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.6" data-path="../operators/creation/interval.html">
            
                <a href="../operators/creation/interval.html">
            
                    
                    interval
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.7" data-path="../operators/creation/of.html">
            
                <a href="../operators/creation/of.html">
            
                    
                    of
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.8" data-path="../operators/creation/range.html">
            
                <a href="../operators/creation/range.html">
            
                    
                    range
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.9" data-path="../operators/creation/throw.html">
            
                <a href="../operators/creation/throw.html">
            
                    
                    throw
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3.10" data-path="../operators/creation/timer.html">
            
                <a href="../operators/creation/timer.html">
            
                    
                    timer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.4" data-path="../operators/error_handling/">
            
                <a href="../operators/error_handling/">
            
                    
                    错误处理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.4.1" data-path="../operators/error_handling/catch.html">
            
                <a href="../operators/error_handling/catch.html">
            
                    
                    catchError
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.4.2" data-path="../operators/error_handling/retry.html">
            
                <a href="../operators/error_handling/retry.html">
            
                    
                    retry
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.4.3" data-path="../operators/error_handling/retrywhen.html">
            
                <a href="../operators/error_handling/retrywhen.html">
            
                    
                    retryWhen
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.5" data-path="../operators/multicasting/">
            
                <a href="../operators/multicasting/">
            
                    
                    多播
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.5.1" data-path="../operators/multicasting/publish.html">
            
                <a href="../operators/multicasting/publish.html">
            
                    
                    publish
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.5.2" data-path="../operators/multicasting/multicast.html">
            
                <a href="../operators/multicasting/multicast.html">
            
                    
                    multicast
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.5.3" data-path="../operators/multicasting/share.html">
            
                <a href="../operators/multicasting/share.html">
            
                    
                    share
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.5.4" data-path="../operators/multicasting/sharereplay.html">
            
                <a href="../operators/multicasting/sharereplay.html">
            
                    
                    shareReplay
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.6" data-path="../operators/filtering/">
            
                <a href="../operators/filtering/">
            
                    
                    过滤
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.6.1" data-path="../operators/filtering/debounce.html">
            
                <a href="../operators/filtering/debounce.html">
            
                    
                    debounce
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.2" data-path="../operators/filtering/debouncetime.html">
            
                <a href="../operators/filtering/debouncetime.html">
            
                    
                    debounceTime
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.3" data-path="../operators/filtering/distinctuntilchanged.html">
            
                <a href="../operators/filtering/distinctuntilchanged.html">
            
                    
                    distinctUntilChanged
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.4" data-path="../operators/filtering/filter.html">
            
                <a href="../operators/filtering/filter.html">
            
                    
                    filter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.5" data-path="../operators/filtering/first.html">
            
                <a href="../operators/filtering/first.html">
            
                    
                    first
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.6" data-path="../operators/filtering/ignoreelements.html">
            
                <a href="../operators/filtering/ignoreelements.html">
            
                    
                    ignoreElements
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.7" data-path="../operators/filtering/last.html">
            
                <a href="../operators/filtering/last.html">
            
                    
                    last
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.8" data-path="../operators/filtering/sample.html">
            
                <a href="../operators/filtering/sample.html">
            
                    
                    sample
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.9" data-path="../operators/filtering/single.html">
            
                <a href="../operators/filtering/single.html">
            
                    
                    single
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.10" data-path="../operators/filtering/skip.html">
            
                <a href="../operators/filtering/skip.html">
            
                    
                    skip
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.11" data-path="../operators/filtering/skipuntil.html">
            
                <a href="../operators/filtering/skipuntil.html">
            
                    
                    skipUntil
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.12" data-path="../operators/filtering/skipwhile.html">
            
                <a href="../operators/filtering/skipwhile.html">
            
                    
                    skipWhile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.13" data-path="../operators/filtering/take.html">
            
                <a href="../operators/filtering/take.html">
            
                    
                    take
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.14" data-path="../operators/filtering/takeuntil.html">
            
                <a href="../operators/filtering/takeuntil.html">
            
                    
                    takeUntil
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.15" data-path="../operators/filtering/takewhile.html">
            
                <a href="../operators/filtering/takewhile.html">
            
                    
                    takeWhile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.16" data-path="../operators/filtering/throttle.html">
            
                <a href="../operators/filtering/throttle.html">
            
                    
                    throttle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.6.17" data-path="../operators/filtering/throttletime.html">
            
                <a href="../operators/filtering/throttletime.html">
            
                    
                    throttleTime
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.7" data-path="../operators/transformation/">
            
                <a href="../operators/transformation/">
            
                    
                    转换
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.7.1" data-path="../operators/transformation/buffer.html">
            
                <a href="../operators/transformation/buffer.html">
            
                    
                    buffer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.2" data-path="../operators/transformation/buffercount.html">
            
                <a href="../operators/transformation/buffercount.html">
            
                    
                    bufferCount
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.3" data-path="../operators/transformation/buffertime.html">
            
                <a href="../operators/transformation/buffertime.html">
            
                    
                    bufferTime
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.4" data-path="../operators/transformation/buffertoggle.html">
            
                <a href="../operators/transformation/buffertoggle.html">
            
                    
                    bufferToggle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.5" data-path="../operators/transformation/bufferwhen.html">
            
                <a href="../operators/transformation/bufferwhen.html">
            
                    
                    bufferWhen
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.6" data-path="../operators/transformation/concatmap.html">
            
                <a href="../operators/transformation/concatmap.html">
            
                    
                    concatMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.7" data-path="../operators/transformation/concatmapto.html">
            
                <a href="../operators/transformation/concatmapto.html">
            
                    
                    concatMapTo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.8" data-path="../operators/transformation/exhaustmap.html">
            
                <a href="../operators/transformation/exhaustmap.html">
            
                    
                    exhaustMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.9" data-path="../operators/transformation/expand.html">
            
                <a href="../operators/transformation/expand.html">
            
                    
                    expand
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.10" data-path="../operators/transformation/exhaustmap.html">
            
                <a href="../operators/transformation/exhaustmap.html">
            
                    
                    exhaustMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.11" data-path="../operators/transformation/groupby.html">
            
                <a href="../operators/transformation/groupby.html">
            
                    
                    groupBy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.12" data-path="../operators/transformation/map.html">
            
                <a href="../operators/transformation/map.html">
            
                    
                    map
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.13" data-path="../operators/transformation/mapto.html">
            
                <a href="../operators/transformation/mapto.html">
            
                    
                    mapTo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.14" data-path="../operators/transformation/mergemap.html">
            
                <a href="../operators/transformation/mergemap.html">
            
                    
                    mergeMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.15" data-path="../operators/transformation/partition.html">
            
                <a href="../operators/transformation/partition.html">
            
                    
                    partition
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.16" data-path="../operators/transformation/pluck.html">
            
                <a href="../operators/transformation/pluck.html">
            
                    
                    pluck
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.17" data-path="../operators/transformation/reduce.html">
            
                <a href="../operators/transformation/reduce.html">
            
                    
                    reduce
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.18" data-path="../operators/transformation/scan.html">
            
                <a href="../operators/transformation/scan.html">
            
                    
                    scan
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.19" data-path="../operators/transformation/switchmap.html">
            
                <a href="../operators/transformation/switchmap.html">
            
                    
                    switchMap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.20" data-path="../operators/transformation/window.html">
            
                <a href="../operators/transformation/window.html">
            
                    
                    window
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.21" data-path="../operators/transformation/windowcount.html">
            
                <a href="../operators/transformation/windowcount.html">
            
                    
                    windowCount
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.22" data-path="../operators/transformation/windowtime.html">
            
                <a href="../operators/transformation/windowtime.html">
            
                    
                    windowTime
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.23" data-path="../operators/transformation/windowtoggle.html">
            
                <a href="../operators/transformation/windowtoggle.html">
            
                    
                    windowToggle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.7.24" data-path="../operators/transformation/windowwhen.html">
            
                <a href="../operators/transformation/windowwhen.html">
            
                    
                    windowWhen
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.8" data-path="../operators/utility/">
            
                <a href="../operators/utility/">
            
                    
                    工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.8.1" data-path="../operators/utility/do.html">
            
                <a href="../operators/utility/do.html">
            
                    
                    do
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.8.2" data-path="../operators/utility/delay.html">
            
                <a href="../operators/utility/delay.html">
            
                    
                    delay
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.8.3" data-path="../operators/utility/delaywhen.html">
            
                <a href="../operators/utility/delaywhen.html">
            
                    
                    delayWhen
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.8.4" data-path="../operators/utility/dematerialize.html">
            
                <a href="../operators/utility/dematerialize.html">
            
                    
                    dematerialize
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.8.5" data-path="../operators/utility/let.html">
            
                <a href="../operators/utility/let.html">
            
                    
                    let
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.8.6" data-path="../operators/utility/timeout.html">
            
                <a href="../operators/utility/timeout.html">
            
                    
                    timeout
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.8.7" data-path="../operators/utility/topromise.html">
            
                <a href="../operators/utility/topromise.html">
            
                    
                    toPromise
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2.9" data-path="../operators/complete.html">
            
                <a href="../operators/complete.html">
            
                    
                    完整列表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="./">
            
                <a href="./">
            
                    
                    食谱
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="2.3.1" data-path="smartcounter.html">
            
                <a href="smartcounter.html">
            
                    
                    智能计数器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="progressbar.html">
            
                <a href="progressbar.html">
            
                    
                    进度条
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.3" data-path="gameloop.html">
            
                <a href="gameloop.html">
            
                    
                    游戏循环
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../concepts/">
            
                <a href="../concepts/">
            
                    
                    概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../concepts/rxjs5-6.html">
            
                <a href="../concepts/rxjs5-6.html">
            
                    
                    RxJS v5 -> v6 升级
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="../concepts/operator-imports.html">
            
                <a href="../concepts/operator-imports.html">
            
                    
                    理解操作符导入
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >智能计数器</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x667A;&#x80FD;&#x8BA1;&#x6570;&#x5668;">&#x667A;&#x80FD;&#x8BA1;&#x6570;&#x5668;</h1>
<p>&#x4E00;&#x4E2A;&#x5728;&#x9875;&#x9762;&#x4E0A;&#x5E26;&#x6709;&#x52A8;&#x6001;&#x66F4;&#x65B0;&#x6570;&#x5B57;&#x6548;&#x679C;&#x7684;&#x6709;&#x8DA3;&#x5143;&#x7D20;&#x5C31;&#x662F;&#x667A;&#x80FD;&#x8BA1;&#x6570;&#x5668;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x79F0;&#x4E4B;&#x4E3A;&#x91CC;&#x7A0B;&#x8868;&#x6548;&#x679C;&#x3002;&#x4E0D;&#x91C7;&#x7528;&#x4E0A;&#x4E0B;&#x8DF3;&#x6570;&#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x800C;&#x662F;&#x5FEB;&#x901F;&#x5730;&#x6E05;&#x70B9;&#x5230;&#x671F;&#x671B;&#x7684;&#x6570;&#x5B57;&#xFF0C;&#x8FD9;&#x80FD;&#x8FBE;&#x5230;&#x4E00;&#x79CD;&#x5F88;&#x9177;&#x7684;&#x6548;&#x679C;&#x3002;&#x80FD;&#x505A;&#x5230;&#x8FD9;&#x70B9;&#x7684;&#x6D41;&#x884C;&#x5E93;&#x7684;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x5C31;&#x662F;&#x7531; <a href="https://github.com/HubSpot" target="_blank">Hubspot</a> &#x6240;&#x5199;&#x7684; <a href="https://github.com/HubSpot/odometer" target="_blank">odometer</a> &#x3002;&#x8BA9;&#x6211;&#x4EEC;&#x6765;&#x770B;&#x770B;&#x5982;&#x4F55;&#x4F7F;&#x7528;&#x77ED;&#x77ED;&#x51E0;&#x884C; RxJS &#x4EE3;&#x7801;&#x6765;&#x5B9E;&#x73B0;&#x7C7B;&#x4F3C;&#x7684;&#x6548;&#x679C;&#x3002;</p>
<div class="ua-ad"><a href="https://ultimateangular.com/?ref=76683_kee7y7vk" target="_blank"><img src="https://ultimateangular.com/assets/img/banners/ua-leader.svg"></a></div>

<h4 id="&#x539F;&#x751F;-js">&#x539F;&#x751F; JS</h4>
<p>( <a href="http://jsbin.com/jojucaqiki/1/edit?js,output" target="_blank">JSBin</a> |
<a href="https://jsfiddle.net/btroncone/au4sqvxu/" target="_blank">JSFiddle</a> )</p>
<pre class="language-"><code class="lang-js"><span class="token comment">// &#x5DE5;&#x5177;&#x51FD;&#x6570;</span>
<span class="token keyword">const</span> <span class="token function-variable function">takeUntilFunc</span> <span class="token operator">=</span> <span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> currentNumber<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> endRange <span class="token operator">&gt;</span> currentNumber
    <span class="token operator">?</span> val <span class="token operator">=&gt;</span> val <span class="token operator">&lt;=</span> endRange
    <span class="token punctuation">:</span> val <span class="token operator">=&gt;</span> val <span class="token operator">&gt;=</span> endRange<span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> <span class="token function-variable function">positiveOrNegative</span> <span class="token operator">=</span> <span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> currentNumber<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> endRange <span class="token operator">&gt;</span> currentNumber <span class="token operator">?</span> <span class="token number">1</span> <span class="token punctuation">:</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> <span class="token function-variable function">updateHTML</span> <span class="token operator">=</span> id <span class="token operator">=&gt;</span> val <span class="token operator">=&gt;</span> <span class="token punctuation">(</span>document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span><span class="token punctuation">.</span>innerHTML <span class="token operator">=</span> val<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">// &#x663E;&#x793A;</span>
<span class="token keyword">const</span> input <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&apos;range&apos;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> updateButton <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&apos;update&apos;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> subscription <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span>currentNumber<span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token function">fromEvent</span><span class="token punctuation">(</span>updateButton<span class="token punctuation">,</span> <span class="token string">&apos;click&apos;</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">pipe</span><span class="token punctuation">(</span>
    <span class="token function">map</span><span class="token punctuation">(</span>_ <span class="token operator">=&gt;</span> <span class="token function">parseInt</span><span class="token punctuation">(</span>input<span class="token punctuation">.</span>value<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token function">switchMap</span><span class="token punctuation">(</span>endRange <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> <span class="token function">timer</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">pipe</span><span class="token punctuation">(</span>
        <span class="token function">mapTo</span><span class="token punctuation">(</span><span class="token function">positiveOrNegative</span><span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> currentNumber<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token function">startWith</span><span class="token punctuation">(</span>currentNumber<span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token function">scan</span><span class="token punctuation">(</span><span class="token punctuation">(</span>acc<span class="token punctuation">,</span> curr<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> acc <span class="token operator">+</span> curr<span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token function">takeWhile</span><span class="token punctuation">(</span><span class="token function">takeUntilFunc</span><span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> currentNumber<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token function">tap</span><span class="token punctuation">(</span>v <span class="token operator">=&gt;</span> <span class="token punctuation">(</span>currentNumber <span class="token operator">=</span> v<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token function">startWith</span><span class="token punctuation">(</span>currentNumber<span class="token punctuation">)</span>
  <span class="token punctuation">)</span>
  <span class="token punctuation">.</span><span class="token function">subscribe</span><span class="token punctuation">(</span><span class="token function">updateHTML</span><span class="token punctuation">(</span><span class="token string">&apos;display&apos;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<h6 id="html">HTML</h6>
<pre class="language-"><code class="lang-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>range<span class="token punctuation">&quot;</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>number<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>update<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>Update<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h3</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>display<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>0<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h3</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x8F7B;&#x6613;&#x5730;&#x83B7;&#x53D6;&#x6211;&#x4EEC;&#x7684;&#x539F;&#x751F; JS &#x6240;&#x5199;&#x7684;&#x667A;&#x80FD;&#x8BA1;&#x6570;&#x5668;&#x5E76;&#x5C06;&#x5176;&#x5305;&#x88C5;&#x5728;&#x4EFB;&#x4F55;&#x6D41;&#x884C;&#x7684;&#x57FA;&#x4E8E; UI &#x5E93;&#x4E2D;&#x3002;&#x4E0B;&#x9762;&#x662F; Angular &#x7248;&#x672C;&#x7684;&#x667A;&#x80FD;&#x8BA1;&#x6570;&#x5668;&#xFF0C;&#x5B83;&#x63A5;&#x6536;&#x4E00;&#x4E2A;&#x66F4;&#x65B0;&#x7ED3;&#x675F;&#x8303;&#x56F4;&#x7684; <code>Input</code> &#x8F93;&#x5165;&#x5C5E;&#x6027;&#x5E76;&#x6267;&#x884C;&#x9002;&#x5F53;&#x7684;&#x8F6C;&#x6362;&#x3002;</p>
<h4 id="angular-&#x7248;&#x672C;">Angular &#x7248;&#x672C;</h4>
<p>(
<a href="https://stackblitz.com/edit/angular-gcnqlq?file=app%2Fnumber-tracker.component.ts" target="_blank">StackBlitz</a>
)</p>
<pre class="language-"><code class="lang-js"><span class="token keyword">import</span> <span class="token punctuation">{</span> Component<span class="token punctuation">,</span> Input<span class="token punctuation">,</span> OnDestroy <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&apos;@angular/core&apos;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> Subject <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&apos;rxjs/Subject&apos;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> timer <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&apos;rxjs/observable/timer&apos;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> switchMap<span class="token punctuation">,</span> startWith<span class="token punctuation">,</span> scan<span class="token punctuation">,</span> takeWhile<span class="token punctuation">,</span> takeUntil<span class="token punctuation">,</span> mapTo <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&apos;rxjs/operators&apos;</span><span class="token punctuation">;</span>

@<span class="token function">Component</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  selector<span class="token punctuation">:</span> <span class="token string">&apos;number-tracker&apos;</span><span class="token punctuation">,</span>
  template<span class="token punctuation">:</span> <span class="token template-string"><span class="token string">`
    &lt;h3&gt; {{ currentNumber }}&lt;/h3&gt;
  `</span></span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token keyword">export</span> <span class="token keyword">class</span> <span class="token class-name">NumberTrackerComponent</span> <span class="token keyword">implements</span> <span class="token class-name">OnDestroy</span> <span class="token punctuation">{</span>
  @<span class="token function">Input</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
  <span class="token keyword">set</span> <span class="token function">end</span><span class="token punctuation">(</span>endRange<span class="token punctuation">:</span> number<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>_counterSub$<span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span>endRange<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
  @<span class="token function">Input</span><span class="token punctuation">(</span><span class="token punctuation">)</span> countInterval <span class="token operator">=</span> <span class="token number">20</span><span class="token punctuation">;</span>
  <span class="token keyword">public</span> currentNumber <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
  <span class="token keyword">private</span> _counterSub$ <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Subject</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token keyword">private</span> _onDestroy$ <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Subject</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

  <span class="token function">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>_counterSub$
      <span class="token punctuation">.</span><span class="token function">pipe</span><span class="token punctuation">(</span>
        <span class="token function">switchMap</span><span class="token punctuation">(</span>endRange <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
          <span class="token keyword">return</span> <span class="token function">timer</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>countInterval<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">pipe</span><span class="token punctuation">(</span>
            <span class="token function">mapTo</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">positiveOrNegative</span><span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>currentNumber<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
            <span class="token function">startWith</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>currentNumber<span class="token punctuation">)</span><span class="token punctuation">,</span>
            <span class="token function">scan</span><span class="token punctuation">(</span><span class="token punctuation">(</span>acc<span class="token punctuation">:</span> number<span class="token punctuation">,</span> curr<span class="token punctuation">:</span> number<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> acc <span class="token operator">+</span> curr<span class="token punctuation">)</span><span class="token punctuation">,</span>
            <span class="token function">takeWhile</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">isApproachingRange</span><span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>currentNumber<span class="token punctuation">)</span><span class="token punctuation">)</span>
          <span class="token punctuation">)</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token function">takeUntil</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>_onDestroy$<span class="token punctuation">)</span>
      <span class="token punctuation">)</span>
      <span class="token punctuation">.</span><span class="token function">subscribe</span><span class="token punctuation">(</span><span class="token punctuation">(</span>val<span class="token punctuation">:</span> number<span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token keyword">this</span><span class="token punctuation">.</span>currentNumber <span class="token operator">=</span> val<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token keyword">private</span> <span class="token function">positiveOrNegative</span><span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> currentNumber<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> endRange <span class="token operator">&gt;</span> currentNumber <span class="token operator">?</span> <span class="token number">1</span> <span class="token punctuation">:</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token keyword">private</span> <span class="token function">isApproachingRange</span><span class="token punctuation">(</span>endRange<span class="token punctuation">,</span> currentNumber<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> endRange <span class="token operator">&gt;</span> currentNumber
      <span class="token operator">?</span> val <span class="token operator">=&gt;</span> val <span class="token operator">&lt;=</span> endRange
      <span class="token punctuation">:</span> val <span class="token operator">=&gt;</span> val <span class="token operator">&gt;=</span> endRange<span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token function">ngOnDestroy</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>_onDestroy$<span class="token punctuation">.</span><span class="token function">next</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>_onDestroy$<span class="token punctuation">.</span><span class="token function">complete</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<h6 id="html">HTML</h6>
<pre class="language-"><code class="lang-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>number<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name">(keyup.enter)</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>counterNumber = vanillaInput.value<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name">#vanillaInput</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span>
    <span class="token attr-name">(click)</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>counterNumber = vanillaInput.value<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    Update number
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>number-tracker</span> <span class="token attr-name">[end]</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>counterNumber<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>number-tracker</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<h3 id="&#x4F7F;&#x7528;&#x5230;&#x7684;&#x64CD;&#x4F5C;&#x7B26;">&#x4F7F;&#x7528;&#x5230;&#x7684;&#x64CD;&#x4F5C;&#x7B26;</h3>
<ul>
<li><a href="../operators/creation/fromevent.html">fromEvent</a></li>
<li><a href="../operators/transformation/map.html">map</a></li>
<li><a href="../operators/transformation/mapto.html">mapTo</a></li>
<li><a href="../operators/transformation/scan.html">scan</a></li>
<li><a href="../operators/combination/startwith.html">startWith</a></li>
<li><a href="../operators/transformation/switchmap.html">switchMap</a></li>
<li><a href="../operators/filtering/takewhile.html">takeWhile</a></li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: 食谱">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="progressbar.html" class="navigation navigation-next " aria-label="Next page: 进度条">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"智能计数器","level":"2.3.1","depth":2,"next":{"title":"进度条","level":"2.3.2","depth":2,"path":"recipes/progressbar.md","ref":"recipes/progressbar.md","articles":[]},"previous":{"title":"食谱","level":"2.3","depth":1,"path":"recipes/README.md","ref":"recipes/README.md","articles":[{"title":"智能计数器","level":"2.3.1","depth":2,"path":"recipes/smartcounter.md","ref":"recipes/smartcounter.md","articles":[]},{"title":"进度条","level":"2.3.2","depth":2,"path":"recipes/progressbar.md","ref":"recipes/progressbar.md","articles":[]},{"title":"游戏循环","level":"2.3.3","depth":2,"path":"recipes/gameloop.md","ref":"recipes/gameloop.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["include-codeblock","advanced-emoji","prism","highlight","copy-code-button","edit-link","github","github-buttons"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/RxJS-CN/learn-rxjs-operators"},"search":{},"lunr":{"maxIndexSize":1000000},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"github-buttons":{"buttons":[{"user":"RxJS-CN","repo":"learn-rxjs-operators","type":"star","size":"small","count":true},{"user":"RxJS-CN","repo":"learn-rxjs-operators","type":"fork","size":"small","count":true}]},"copy-code-button":{},"advanced-emoji":{"embedEmojis":false},"include-codeblock":{"check":false,"edit":false,"fixlang":false,"lang":"","template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"帮忙纠错","base":"https://github.com/RxJS-CN/learn-rxjs-operators/tree/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"index.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"学习 RxJS 操作符","gitbook":"3.1.1"},"file":{"path":"recipes/smartcounter.md","mtime":"2018-10-15T09:07:06.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2018-10-15T09:31:22.754Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

